<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-10-10 17:05:56
         compiled from "D:\WebApplication\myconpany\sumi_mobile\application\views\shopcart\index.html" */ ?>
<?php /*%%SmartyHeaderCode:17722561884fb5c6554-19622450%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '3c365512bdc503d7c6c77a5c03aec5ed7267d422' => 
    array (
      0 => 'D:\\WebApplication\\myconpany\\sumi_mobile\\application\\views\\shopcart\\index.html',
      1 => 1444467954,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '17722561884fb5c6554-19622450',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.21-dev',
  'unifunc' => 'content_561884fb875df4_98078572',
  'variables' => 
  array (
    'user_action' => 0,
    'conpanylist' => 0,
    'item' => 0,
    'contacts' => 0,
    'order_info' => 0,
    'product' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_561884fb875df4_98078572')) {function content_561884fb875df4_98078572($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/header.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<section class="wrap">
    <p class="self-stock-title bff"><span class="orange">配送方式</span></p>
    <p class="tgb_radio delivery">
        <label class="pr10p"><input name="zt" type="radio" class="btn_radio" <?php if ($_smarty_tpl->tpl_vars['user_action']->value['area_id']=='T') {?>checked="checked"<?php }?> value="T"> 自提</label>
        <label class="pr10p"><input name="zt" class="btn_radio" <?php if ($_smarty_tpl->tpl_vars['user_action']->value['area_id']=='S') {?>checked="checked"<?php }?>  type="radio" value="S"> 配送</label>
    </p>


    <div class="tgb_wrmg">
        <p class="self-stock-title bff"><span class="orange">联系信息</span></p>
        <ul class="to-c" style="background:#fff;">
            <?php if ($_smarty_tpl->tpl_vars['conpanylist']->value=='') {?>
            <li><span class="">公司名称：</span><input type="text" value="" name="business_name" class="to-c-fp"></li>
            <li><span class="">联 系 人 ：</span><input type="text" name="contacts" class="to-c-fp" placeholder="请填写联系人"/></li>
            <li><span class="">手机号码：</span><input type="text" name="mobile" class="to-c-fp" placeholder="请填写手机号码"/></li>
            <?php } else { ?>
            <li><span class="sp_ts">选择公司：</span>
                <select name="sup_id" class="to-c-fp" id="select">
                    <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['conpanylist']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
?>
                    <option value="<?php echo $_smarty_tpl->tpl_vars['item']->value['id'];?>
" <?php if ($_smarty_tpl->tpl_vars['item']->value['is_default']=='Y') {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['item']->value['business_name'];?>
</option>
                    <?php } ?>
                </select>
            </li>
            <li><span class="">联 系 人 ：</span><input type="text" name="contacts"  value="<?php echo $_smarty_tpl->tpl_vars['contacts']->value['contacts'];?>
" class="to-c-fp" placeholder="请填写联系人"/></li>
            <li><span class="">手机号码：</span><input type="text" name="mobile" value="<?php echo $_smarty_tpl->tpl_vars['contacts']->value['mobile'];?>
"   class="to-c-fp" placeholder="请填写手机号码"/></li>
            <?php }?>
        </ul>
    </div>

    <div class="self-stock mt10p">

        <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['order_info']->value['order_sku']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
?>
        <p class="self-stock-title bff"><span class="orange">商品清单</span></p>
        <p class="self-stock-title"><?php echo $_smarty_tpl->tpl_vars['item']->value['cate_name'];?>
 <?php echo $_smarty_tpl->tpl_vars['item']->value['product_name'];?>
 <?php echo $_smarty_tpl->tpl_vars['item']->value['brand_name'];?>
 </p>
        <p class="fs14p orange pl10p pt10p"><span class="fs14p"><?php echo $_smarty_tpl->tpl_vars['item']->value['currency_mark'];?>
</span><?php echo $_smarty_tpl->tpl_vars['item']->value['price'];?>
<span class="fs14p">元/吨</span><span class="sst-orange">实盘</span></p>
        <p class="sst-te"><span class="sst-te2">厂商：<?php echo $_smarty_tpl->tpl_vars['item']->value['brand_name'];?>
</span><span class="sst-te1">产品类型：<?php echo $_smarty_tpl->tpl_vars['item']->value['service_name'];?>
</span></p>
        <p class="sst-te"><span class="sst-te2">交货时间：<?php echo $_smarty_tpl->tpl_vars['item']->value['delivery_time'];?>
</span><span class="sst-te1">交货地点：<?php echo $_smarty_tpl->tpl_vars['item']->value['delivery_area'];?>
</span></p>

        <ul class="to-c" style="background:#fff;">
            <li><span>数量：</span><input name="product_num" num="<?php echo $_smarty_tpl->tpl_vars['item']->value['real_num'];?>
" price="<?php echo $_smarty_tpl->tpl_vars['item']->value['price'];?>
" product_id="<?php echo $_smarty_tpl->tpl_vars['item']->value['product_id'];?>
" type="text" class="to-c-fp product_num" style="min-width:80px;width:80px;" value="5" placeholder="请填写数量"/>/吨</li>
        </ul>
        <?php } ?>
        <p class="sale_zr">应付总额：<span class="orange fwb "><?php echo $_smarty_tpl->tpl_vars['product']->value['currency_mark'];?>
</span> <span class="orange fwb total_price"><?php echo $_smarty_tpl->tpl_vars['product']->value['price']*$_smarty_tpl->tpl_vars['product']->value['num'];?>
</span></p>
        <div class="sub-order"><a href="#">提交订单</a></div>

    </div>



    <?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/common/footerlogin.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>



</section>

<?php echo '<script'; ?>
 typte="text/javascript">
    $(function(){
        //更新配送方式
        $(".delivery").click(function(){
            var dm = $("input[name='zt']:checked").val();
            var dr = $("input[name='delivery_addr']").val();

            $.ajax({
                url:'/shopcart/delivery',
                data:{dm:dm,dr:dr},
                type:'POST',
                success:function(data){
                    false;
                },
                dataType:'text'
            });
        });

        $(".delivery_addr").blur(function(){
            var dr = $("input[name='delivery_addr']").val();

            $.ajax({
                url:'/json/delivery_addr.html',
                data:{dr:dr},
                type:'POST',
                success:function(data){
                    false;
                },
                dataType:'text'
            });
        });


        $('input.product_num').change(function(){
            var pn = $(this);
            var tp = $(".total_price");
            var product_num = parseFloat(pn.val());
            var product_id = pn.attr('product_id');
            var real_num = parseFloat(pn.attr('num'));
            var price = pn.attr('price');

            if(product_num > real_num){
                alert("不可超过可售数量！");
                pn.val(real_num);
                product_num = pn.val();
                tp.text(product_num*price);
                //开始更新数量
                update_product_num(product_id,product_num)
            }else{
                product_num = pn.val();
                tp.text(product_num*price);
                update_product_num(product_id,product_num)
            }
        });

        function update_product_num(product_id,product_num){
            $.ajax({
                url:'/shopcart/update_num',
                data:{product_id:product_id,product_num:product_num},
                type:'POST',
                success:function(data){
                    false;
                },
                dataType:'text'
            });
        }
    });
<?php echo '</script'; ?>
>

<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/footer.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php }} ?>
